USE[DeltaFlex]
GO
IF(OBJECT_ID('dbo.ALBARA')IS NOT NULL)
	DROP table dbo.ALBARA
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE ALBARA(
	IDALBARA int NOT NULL,
	IDORDRE int NOT NULL,
	IDCLIENT int NOT NULL,
	DATA date NOT NULL,
	TOTAL decimal(8,4) NOT NULL
	
 CONSTRAINT PK_ALBARA PRIMARY KEY CLUSTERED 
(
	IDALBARA  ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

IF (OBJECT_ID('SEQ_ALBARA')IS NOT NULL)
	DROP SEQUENCE SEQ_ALBARA
GO

CREATE SEQUENCE SEQ_ALBARA
	START WITH 1
    INCREMENT BY 1
    MINVALUE 1
    MAXVALUE 9223372036854775807;

GO

